﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 图书管理系统
{
    public partial class LoginForm : Form
    {
        public int mode;

        public string Uid;
        public LoginForm()
        {
            InitializeComponent();
        }

        private void Login_button_Click(object sender, EventArgs e)
        {
            PwdLoginForm pwdloginForm = new PwdLoginForm();
            if (pwdloginForm.ShowDialog() == DialogResult.OK)
            {
                this.Uid = pwdloginForm.Uid;
                this.mode = pwdloginForm.mode;
                this.DialogResult = DialogResult.OK;
            }
        }

        private void FaceLogin_button_Click(object sender, EventArgs e)
        {
            FaceMatchForm facematchform = new FaceMatchForm();
            if (facematchform.ShowDialog() == DialogResult.OK)
            {
                this.Uid = facematchform.Uid;
                this.mode = facematchform.mode;
                this.DialogResult = DialogResult.OK;
            }
        }

        private void Register_button_Click(object sender, EventArgs e)
        {
            RegisterForm registerForm = new RegisterForm();
            if (registerForm.ShowDialog() == DialogResult.OK)
            {

            }
        }

        private void Signout_button_Click(object sender, EventArgs e)
        {
            Utils.SQLTool.CloseSql();
            this.Close();
        }

    }
}
